ΓÇó extract the text in the background fields of any stack
ΓÇó extract the scripts of any stack
and then format, edit and print the fields or the scripts using MSWord Version 4.
Stack Dumper generates files that can be processed through the "Print Merge" facility of MSWord to produce fully-formatted reports from HyperCard stacks. All of MSWord's formatting facilities can be applied to produce documents from stacks. The table construction facilities of Word 4 are especially useful when printing the contents of stacks that contain multi-field cards.
What Stack Dumper does:
ΓÇó The "Dump fields" button dumps the text from the background fields in all the cards of the target stack. The text is dumped into a set of MSWord DATA files, one for each background. A paragraph is produced for each card with the fields separate by tab characters. The first paragraph in each file contains a set of tab-separated field names as required by MSWord's Print Merge facility.
ΓÇó The "Dump scripts" button dumps the scripts of all of the objects in the target stack. An MSWord DATA file is produced with a paragraph for each object. Each paragraph contains four tab-separated fields giving the name of the object, the object number, the relevant properties of the object and the script of the object. The first paragraph in the file contains a set of tab-separated field names as required by MSWord's Print Merge facility.
Using Stack Dumper:
Click the "Dump fields" button or the "Dump Scripts" button. Stack Dumper uses the standard file dialog to get you to specify the target stack, then:
ΓÇó When dumping fields Stack Dumper gives the name of each background in the message box and then asks you whether you want to dump the fields of that background. If you select "yes", it uses the standard file dialog again to enable you to select a name for the MSWord file that will be generated. Stack Dumper then dumps the contents of the background fields of all of the cards of that background, giving indications of progress in the message box.
ΓÇó When dumping scripts Stack Dumper uses the standard file dialog to enable you to select a name for the MSWord file that will be generated. Then it proceeds to dump the relevant properties and the script for each of the objects of the target stack. Progress is indicated by giving the name and other details of the object currently being processed in the message box.
Formatting the results:
To use Stack Dumper to the full you should be familiar with MSWord's Print Merge facility. Stack Dumper generates DATA files as are required by the Print Merge system. These are pure ASCII text documents that can be processed through the Print merge operation to produce the (inappropriately named) "Form letter" documents.
To perform the Print Merge operation you must supply a "main document" file. The "main document" file can be thought of as a template, containing pointers to:
a) the DATA file that is to be processed to make the "Form Letters";
b) the fields in the DATA file that are to be included in the "Form Letters".
For printing scripts, a standardised "main document" file can be used to process the scripts dumped from any stack. A model "main document" file for printing scripts (called "SD scripts.format") is supplied with Stack Dumper. You can vary choice of fonts and layout in the scripts that you print by making different format files.
For printing the contents of dumped background fields a different "main document" file is required for each background that has been dumped.
For example, if you have dumped the background called "info" into an MSWord file called "Info.text" and the background has three fields, of which field 2 is a heading for each card, you could use a main document containing:
<<DATA Info.text>>
<<Field2>>
<<Field1>><<Field3>>
(Where << and >> denote the MSWord "field delimiter" brackets.) Open this file, select "Print Merge...", and then "New Document" and MSword will create a "Form Letter" document containing a Section for each card in the dumped background.
Sections in MSword are normally used to delimit something large, like a chapter. The Print Merge operation compels us to use them for a much smaller (the contents of a single card), but fortunately, we can arrange to print several sections to a page.
To layout a document with several cards to the page, select all of the text in the document and then select "No Break" in the "Section..." dialog. (Or you can do the same in the main document BEFORE using Print Merge).
A model "main document" file for printing background fields with a layout similar to that described above is supplied with Stack Dumper. It is called "SD fields.format".
You can use the "Dump text" button on this stack to get a printed version of this information. "SD fields.format" is a Word 4 "Main document" file that you can "Print Merge" with the text file to make an Stack Dumper manual.
But since this stack has only has one card, the above doesn't fully illustrate the power of Stack Dumper. Try it on one of your own databases.
Notes:
- if an MSWord DATA file generated by Stack Dumper is altered with MSWord, it should be saved via the "Save as..." command with the file type set to Normal. This is essential to ensure that the "Shift return" characters are not converted to paragraph delimiters.
Legal matters:
Stack Dumper is Freeware. You are free to use it, but I retain the copyright.
If you build the Stack Dumper scripts into any of your stacks, give me and my university an acknowledgement. If you want to use any of my code in a product, contact me for a licence.
I hope you find "Stack Dumper" useful. Please e-mail me if you like it. Let me know about any problems or improvements that you discover too.
Change history:
- A primitive version of this stack, called Stack Dumper 1.0 was released in September 1989. That version could only dump background fields, not scripts, and you were required to copy its scripts into the target stack before you could use the dumping facilities.
- I subsequently learned enough about HyperTalk to realise that this cumbersome method of use was entirely unnecessary (because the execution environment of the current script goes with you when you "go to" another stack).
- Harold Thimbleby (of Stirling University, co-inventor of the LiveWare concept, described in a recent issue of New Scientist and of which I'm sure you'll hear more anon) sent me a stack that he had developed to dump the scripts of stacks in the form of a TeX file (suitable for processing by TeXTures, Addison-Wesley's Macintosh TeX application. He suggested that I should extend my stack to enable scripts to be formatted and printed via Word.
- Stack Dumper 2.0 is the second released version of Stack Dumper. It is more-or-less a complete re-write of the 2.0 release, incorporating, I think, a much more elegant use of HyperTalk to solve the problems that it addresses. (This must be one ofthe fastest upgrades in history, but I think it is justified by the new functionality of SD 2.0!)